﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
	<meta charset="utf-8" />
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="websocket.js"></script>
</head>
<body>
    <script>
        var socket;
        function conn() {
             
            socket = new UDCsocket({
                ip: '127.0.0.1', port: 11001, conn: function () {
                    alert("连接成功");
                    socket.SendData(1, "weblogin", "", "");
                }
              , recData: function (text) {
                  $('#test').append("收到:" + text + '<br/>  ')//这个意思你们都懂了把
              }
              , close: function () { alert("连接关闭"); }
               , error: function (msg) { alert("连接错误" + msg); }
                , jump: function (ip) { alert("服务器超过最大连接，请连接其他服务器：" + ip); }
            });

        }
    </script>
    <input type="button" value="点击开始连接" onclick="conn()" />
           <div id="test">

    </div>
</body>
</html>
